package com.skyline.user.dao;

import java.util.List;

import com.skyline.base.type.Activity;
import com.skyline.common.bean.Page;
import com.skyline.user.model.Fan;
import com.skyline.user.type.IdolType;

public interface FanDao {

	/**
	 * 查找粉丝
	 * 
	 * @param idolId
	 * @return
	 */
	public List<Fan> queryFansByIdolId(Long idolId, Page page, Activity activity);

	/**
	 * 根据关注类型筛选关注
	 * 
	 * @param fanId
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryIdolsByFanId(Long fanId, Page page, Activity activity);

	/**
	 * 根据关注类型筛选关注
	 * 
	 * @param fanId
	 * @param idolType
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryIdolsByFanIdAndIdolType(Long fanId, IdolType idolType, Page page, Activity activity);

	/**
	 * 判断是否关注
	 * 
	 * @param idolId
	 * @param fanId
	 * @return
	 */
	public int countFans(Long idolId, Long fanId, Activity activity);

	/**
	 * 计算粉丝数
	 * 
	 * @param idolId
	 * @return
	 */
	public int countNormalFans(Long idolId);// 计算对象fans数

	/**
	 * 根据关注类型计算已关注数
	 */
	public int countNormalIdols(Long fanId, IdolType idolType);

	/**
	 * 插入关注
	 * 
	 * @param idolId
	 * @param idolNickname
	 * @param idolPortrait
	 * @param fanId
	 * @param fanNickname
	 * @param fanPortrait
	 * @param idolType
	 */
	public void insertFan(Long idolId, String idolNickname, String idolPortrait, Long fanId, String fanNickname,
			String fanPortrait, IdolType idolType);

	/**
	 * 更新关注状态
	 * 
	 * @param idolId
	 * @param fanId
	 * @param activity
	 */
	public void updateFanActivity(Long idolId, Long fanId, Activity activity);

	/**
	 * 获取共同关注列表
	 * 
	 * @param ownerId
	 * @param viewerId
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryBothIdols(Long ownerId, Long viewerId, Page page, Activity activity);

	/**
	 * 获取共用关注列表
	 * 
	 * @param ownerId
	 * @param viewerId
	 * @param idolType
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryBothIdolsByIdolType(Long ownerId, Long viewerId, IdolType idolType, Page page,
			Activity activity);

	/**
	 * 获取关注列表，包含共同关注标识
	 * 
	 * @param ownerId
	 * @param viewerId
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryIdolsWithFollowed(Long ownerId, Long viewerId, Page page, Activity activity);

	/**
	 * 获取关注列表，包含共同关注标识
	 * 
	 * @param ownerId
	 * @param viewerId
	 * @param idolType
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryIdolsByIdolTypeWithFollowed(Long ownerId, Long viewerId, IdolType idolType, Page page,
			Activity activity);

	/**
	 * 获取粉丝列表，包含已关注标识
	 * 
	 * @param idolId
	 * @param viewerId
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryFansWithFollowed(Long idolId, Long viewerId, Page page, Activity activity);

	/**
	 * 获取相互关注列表
	 * 
	 * @param ownerId
	 * @param page
	 * @param activity
	 * @return
	 */
	public List<Fan> queryEachOtherIdols(Long fanId, Page page, Activity activity);

}
